home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00a.txt
/
000016_icon-group-sender _Mon Jan 24 08:29:36 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
3KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA29177
for icon-group-addresses; Mon, 24 Jan 2000 08:27:31 -0700 (MST)
Message-Id: <200001241527.IAA29177@baskerville.CS.Arizona.EDU>
From: Bob Ardler <ardler@argonet.co.uk>
To: <icon-group@optima.CS.Arizona.EDU>
Date: Sun, 23 Jan 2000 12:04:01 +0000 (GMT)
Subject: permutations a la real Icon
User-Agent: Pluto/1.13f (RISC-OS/3.60)
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
(Thread called 'Question' or 'permutations', etc)
Steve Graham:
> Marc Espie:
> >suspend l[i to *l] <-> l[i] & permute(l, i+1)
>I don't really understand what's going on here. I gather there's a
>reversible assignment being used and a recursive call. Can you shed
>some light on this?
Me too. My iterative Basic permuter transcribed to Icon, FORs to
everys, is embarrassingly long and 20% slower than Marc's.
Marc Espie's program is real Icon as opposed to the
Algol-with-singing-dancing-strings subset of Icon which, as a
non-programmer I use for small text or numeric jobs.
No doubt time or urgency or an on-site guru or intelligence transplant
would enable one to learn real Icon, exploiting generators, suspension
and coexpressions.
However I believe there is a pedagogic problem here. I have the Griswold
book, 3rd edition. It's the best manual, best text-book and best primer
I've seen, all in under 400 pages. A remarkable achievement, evidence
that some computer scientists may be human.
Yet their patient chapters on string scanning and co-expressions couldn't
penetrate this skull. I think the missing pedagogic tools are
(1) rigorous (as in maths) definitions and statements of the semantics
involved
(2) historical asides explaining the origin of, eg, co-expressions
(3) a type of diagram, or perhaps a style of layout, which can show the
flow of control in a statement like Marc's above.
I am thinking of how, since Algol, the physical layout with indentation
of a procedural language has enabled learners and non-programmers to
write short programs and see what's going on.
"char* yukk = squawk; while ( *squawk++ = *crep++ ) ; return yukk;" is
just a gag. But 'real' Icon, like functional languages, is forced to have
one-liners with many invisible lines of control flow.
I haven't seen text-book diagrams to exhibit the behaviour of generators
or show the flow in suspension/resumption.
Do any of you have such things in your lecture notes or use them on the
blackboard? Or know of texts which diagram or elucidate 'horizontal'
control flow?
--
Bob Ardler, ardler@argonet.co.uk